/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycity.servlets;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mycity.dao.*;
/**
 *
 * @author celikeins
 */
public abstract class Base {
    	protected HttpServletRequest request;
	protected HttpServletResponse response;
	
	public Base(HttpServletRequest request, HttpServletResponse response) {
		this.request = request;
		this.response = response;
	}
	
	public UserTab getCurrentUser(){
		return (UserTab)request.getSession().getAttribute("user_info");
	}
        
	public void setCurrentUser(UserTab user) {
		request.getSession().removeAttribute("user_info");
		request.getSession().setAttribute("user_info",user);
	}
}
